import re
import urllib2

srcurl = 'http://www.jianshu.com/'
request = urllib2.Request(srcurl)

def getArticleList(req):
    reg = re.compile(r'href="/p/\w+"')
    return re.findall(reg,urllib2.urlopen(req).read())



for path in getArticleList(request):
    print 'sucess'
    unfullname = re.search(r'"/p/(\w+)"',path).group(1)
    cont = urllib2.urlopen(request).read()
    f = open('Article/'+ unfullname+'.html','w+')
    f.write(cont);
    f.close()
    print unfullname + ' in Ariticle/'
